package org.zjsru.order.service;

import org.springframework.stereotype.Component;
import org.zjsru.order.pojo.Product;

@Component
public class ProductFeignClientFallback implements ProductFeignClient {
    
    @Override
    public Product getProductById(Long productId) {
        // 服务降级时返回null或默认商品信息
        return null;
    }
    
    @Override
    public boolean decreaseStock(Long productId, Integer quantity) {
        return false;
    }
    
    @Override
    public boolean increaseStock(Long productId, Integer quantity) {
        return false;
    }
    
    @Override
    public String deductStock(String productId, int count) {
        return "服务降级：商品服务暂不可用，请稍后重试";
    }
}